public class Prime {
    public static void main(String[] args) {
        System.out.println("1-100之间的质数有：");
        for (int i =2 ; i < 100; i++) {
            boolean zhishu = true;
            for (int j = 2; j < i - 1; j++) {
                if (i % j == 0) {
                    zhishu = false;
                    break;
                }
            }
            if (zhishu) {

                System.out.print( i + ",");
            }
        }
    System.out.println("");
    System.out.println("~~~~~~~~~~~~~~");
    System.out.println("前100个质数为：");
    int count=0;
        for (int i =2 ;count<100; i++) {
            boolean zhishu = true;
            for (int j = 2; j<i-1; j++) {
                if (i % j == 0) {
                    zhishu = false;
                    break;
                }
            }
            if (zhishu) {
                count++;
                System.out.print( i + ",");
            }
        }
            
    }
}
